import request from "@/util/request";

export function addUserAchieve(data){
    return request({
        url: '/user_achieve/add',
        method: 'post',
        data: data
    })
}

export function list(tabId, pageNum, pageSize){
    return request({
        url: '/user_achieve/getListByUserId?userId=' + JSON.parse(sessionStorage.getItem('userInfo')).id + '&tabId=' + tabId + '&pageNum=' + pageNum + '&pageSize=' + pageSize,
        method: 'get'
    })
}

export function allUserList(pageNum, pageSize, time, userId){
    return request({
        url: '/user_achieve/page?pageNum=' + pageNum + '&pageSize=' + pageSize + '&time=' + time + '&userId=' + userId,
        method: 'get'
    })
}

export function pageCondition(pageNum, pageSize, time, userId){
    return request({
        url: '/user_achieve/pageByCondition?pageNum=' + pageNum + '&pageSize=' + pageSize + '&time=' + time + '&userId=' + userId,
        method: 'get'
    })
}

export function excel(){
    return request({
        url: '/user_achieve/excel',
        method: 'post',
        responseType: 'blob'
    })
}

export function deleteUserAchieveById(id){
    return request({
        url: '/user_achieve/delete/' + id,
        method: 'delete'
    })
}

export function updateUserAchieve(userAchieve){
    return request({
        url: '/user_achieve/update',
        method: 'post',
        data: userAchieve
    })
}